package com.matt.service.estimate.strategy;

import com.matt.service.estimate.EstimateStrategy;

import java.util.HashMap;
import java.util.Map;

public class StrategyContext {
    private static final Map<String, EstimateStrategy> registerMap = new HashMap<>();

    // 注册
    public static void registerStrategy(String estimateType, EstimateStrategy estimateStrategy) {
        registerMap.put(estimateType, estimateStrategy);
    }

    // 获取
    public static EstimateStrategy getEstimateStrategy(String estimateType) {
        return registerMap.get(estimateType);
    }

}
